import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/modules/cabinet/pages/cabinet_form/view.dart';
import 'package:honeypotflutter/public/views/public_appBar.dart';
import 'package:honeypotflutter/publicBussine/bussine_image.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_card.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_item.dart';
import '../cabinet_list/view.dart';
import 'logic.dart';

class CabinetPage extends StatefulWidget {
  const CabinetPage({Key? key}) : super(key: key);

  @override
  State<CabinetPage> createState() => _CabinetPageState();
}

class _CabinetPageState extends State<CabinetPage> {
  final CabinetLogic logic = Get.put(CabinetLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: HLAppBar(navigationTitle: "网点柜机管理"),
      body: Stack(
        children: [
          Image.asset(MGImage.image("cabinet_back", type: ImagePathType.cabinet)),
          MGCard(
            margin: EdgeInsets.only(left: 20, right: 20, top: 200),
            children: [
              MGItems(
                leadTitle: "柜机基础管理",
                showBottomSplit: true,
                trailingIcon: MGImage.image("public_next"),
                action: () {
                  Get.to(CabinetListPage());
                },
              ),
              MGItems(
                leadTitle: "柜机报表管理",
                trailingIcon: MGImage.image("public_next"),
                action: () {
                  Get.to(CabinetFormPage());
                },
              )
            ],
          )
        ],
      ),
    );
  }

  @override
  void dispose() {
    Get.delete<CabinetLogic>();
    super.dispose();
  }
}
